General Information About Crypto Crypto will encode and decode text messages for you by using the matrix that you specify. (A matrix is simply an array of numbers.) Crypto can also help you break someone else’s code. A description of the two modeless dialogs follows. After that, there is a list of references that describe how the coding system works. The characters that can be encoded are usually just the capital letters from A to Z, the numerals 0 to 9, and the period. This can be changed, however. (see Other Features) No spaces can be used, but a period can be used instead. The Plaintext is the plain English, decoded message. The Ciphertext is the encoded message. How to Use the Encode/Decode Dialog This dialog will encode and decode your text messages using the 2x2 or 3x3 matrix that you give it. If you use a 2x2 matrix, it must be placed in the upper, left-hand corner of the grid. You can enter either the encoding or the decoding matrix, and the program will calculate the other one for you when you hit the appropriate button. If the matrix is not usable (i.e. not invertible modulo , see References), then the program will tell you. By randomly changing the numbers that you entered, you will eventually end up with a usable matrix. The Encode button will use the current encoding matrix to encode the Plaintext you entered. The Decode button will use the current decoding matrix to decode the Ciphertext you entered. How to Use the Crack Dialog Note: This dialog is essentially useless unless you are taking a class about encryption. See the last two paragraphs for the reasons. This dialog will help you crack messages that have been encoded with 2x2 or 3x3 matrices. The basic ideas is that, if you know what a small part of the message means, you can sometimes discover what the entire message says. First, however, you must guess whether the message was encoded with a 2x2 matrix or with a 3x3 matrix and also what character set was used. The description assumes a 2x2 matrix; substitute ‘3’ for ‘2’ to figure out what to do for a 3x3 matrix. Since only certain groupings of the Ciphertext letters will yield a usable result, divide the message into groups of 2 letters and discard the last group. Any 2 of these groups may yield a usable result. (Any other combinations will guaranteed not yield a usable result.) Now comes the hard part. You must choose 2 groups of letters and guess what their decoded meaning is. Enter the Ciphertext letters in the box at the top. Then enter the possible decoded meaning of the Ciphertext in the second box. A large part of the Ciphertext message should be entered in the third box. When you hit the Decode button, the program will try to crack the code and decode the message. If it is successful, it will display the decoded message and the matrix used to encode the message. Since the program can’t recognize words, you then have to decide whether or not the decoded message is worth anything. For reasons explained in the references, the program may claim that a decoded message doesn’t work, even if it is correct. In the case of a 2x2 matrix, there are 456976 possible decoded meanings for each of the possible 4 character Ciphertext strings. This means that you will probably have a very hard time guessing what any of the Ciphertext means. To make this a little easier, you can scan through the possible decoded meanings by pressing the Find Next Possibility button. The program will start from the current possibility and scan forward to find the next usable possibility. It will then display the decoded message so you can evaluate it. Scanning can be a very long process, so you can use the Stop button if you want to stop and try something else. Not only is it nearly impossible to guess what the ciphertext means, but for the simple 26 letter character set, there are about 4E26 possible arrangements. Guessing which one was used for encoding is therefore nearly impossible unless you're psychic. This is why the crack dialog is so useless. (But I still think it's neat.) References The type of encryption used is called a Hill Cipher. You have to understand modular arithmetic and matrix algebra before you can fully understand the encryption and cracking processes. The first reference explains matrix algebra and contains a section on the Hill Cipher. I used it when I wrote this program. The other two references are recommended by the author of the first book. 1) Howard Anton and Chris Rorres, “Elementary Linear Algebra with Applications,” New York: John Wiley & Sons, Inc., 1987. 2) Abraham Sinkov, “Elementary Cryptanalysis, a Mathematical Approach,” Mathematical Association of America, Mathematical Library, 1966. 3) Alan G. Konheim, “Cryptography, a Primer,” New York: Wiley - Interscience, 1981. Other Features The Load Text menu item will read the text file that you specify and place the text in the Plaintext box or the Ciphertext box. The Save Text menu item will save the text in the Plaintext box or the Ciphertext box in a text file. The type of text file can be specified in the Preferences dialog. The Character Set menu item allows you to change which characters the program will encrypt. This can be useful if you want to write a message in a different language. You can also rearrange the letters to make the code even harder to crack. For the best results, the number of characters in the set should be a prime number, because then almost all matrices will be usable. The Print option on the Control menu will print the information in the currently active dialog. The Edit menu items allow you to transfer text between the various editable text items in the dialogs. The Undo menu item does nothing. Registration If you have any suggestions for improving this program, please let me know. If you haven't paid for the program, please do so. It took a lot of effort to get the program to work, so a contribution of US$5 or more will be greatly appreciated. I'll be happy to send you a list of my other programs if you want me to. I also do custom programming, in case you need a program that will do something special. My address is: John Lindal P.O. Box 4092 Point Dume, CA 90264 My E-mail address is: jafl@alice.wonderland.caltech.edu Disclaimer I have tried to debug this program on all the common Macs. However, I can't guarantee that it will work with all systems. If the program does crash, send me a letter telling me how it happened, and I'll try to fix the problem. Please don't feel that you have to pay for the program before you report a problem. (But it wouldn't hurt.) I'm more interested in fixing bugs and getting new ideas than getting paid for the program. Bugs Fixed from Previous Versions 1) Numbers occasionally appeared with a slash in the middle. (This one was very rare.) 2) Round-off errors would occasionally prevent the code cracking routine from working correctly. (This was also very rare.) 3) Michael Dautermann pointed out that encoding only A-Z was almost useless. He’s right, so now Crypto can encode any set of characters (except space) that you specify. 4) The Cut, Copy, and Paste menu items now transfer the text to the clipboard so that you can use the text in other programs. 5) Michael Dautermann also pointed out that encoding only 255 characters was almost useless. He’s right, so now Crypto can encode up to 32767 characters. 6) Lloyd Wood pointed out that the fonts in my program were interfering with the system's fonts.